package top.xia17.plugins.fast.user.model.query;

import top.xia17.plugins.fast.common.database.jpa.query.BaseQuery;
import top.xia17.plugins.fast.common.database.jpa.query.Query;
import lombok.Data;
import lombok.experimental.Accessors;
import top.xia17.plugins.fast.user.dao.entity.User;

/**
 * 用户查询条件
 *
 * @author xia17
 * @since 2021/7/21 20:03
 */
@Data
@Accessors(chain = true)
public class UserQuery implements BaseQuery<User> {

    /**
     * 用户名或者昵称
     */
    @Query(blurry = "username,nickname")
    private String blurry;

    /**
     * 用户名like
     */
    @Query(type = Query.Type.INNER_LIKE)
    private String username;

    /**
     * 昵称like
     */
    @Query(type = Query.Type.INNER_LIKE)
    private String nickname;

    /**
     * 邮箱like
     */
    @Query(type = Query.Type.INNER_LIKE)
    private String phone;

    /**
     * 邮箱like
     */
    @Query(type = Query.Type.INNER_LIKE)
    private String email;

    /**
     * 是否冻结
     */
    @Query
    private Boolean isFreeze;

    /**
     * 是否启用
     */
    @Query
    private Boolean enabled;


    /**
     * 部门编号相等
     */
    @Query(join = Query.Join.LEFT, joinName = "dept", propName = "id")
    private Long deptId;

    /**
     * 部门名称like
     */
    @Query(join = Query.Join.LEFT, joinName = "dept", propName = "name", type = Query.Type.INNER_LIKE)
    private String deptName;

    /**
     * 部门名称like
     */
    @Query(join = Query.Join.LEFT, joinName = "dept", propName = "code", type = Query.Type.INNER_LIKE)
    private String deptCode;


}
